<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>sitenav.html</title>
    <link rel="stylesheet" href="./css/商城导航.css">
  <link rel="stylesheet" href="./font_3366928_6aytrri25q9/iconfont.css">

</head>
<body>
    <div class="header">
        <span class="back"><</span>
        <span class="sheng">商品导航
               </span>
        <i class="iconfont icon-xiazai"></i>
    </div>
   
        <ul class="box">
            <!-- <li>
                <a href="">
                    <img src="../../img/10.jpg" alt="">
                    <span>京东商城</span>
                </a>
            </li> -->
        </ul>
    
    <section class="footer">
        <div class="more">
            <a href="">更多信息优惠>></a>
        </div>
        <div class="zhekou">
            <p>品牌排行</p>
            <a href="">
                <div>></div>
            </a>
        </div>
        <div class="row">
            <div>登入</div>
            <div>注册</div>
            <div>返回顶部</div>
        </div>
        <a href="">
            <p class="lie">
                手机APP下载 万锋智慧商城手机版 -- 掌上比价平台
            </p>
        </a>
        <p class="last">
            chst.vip:8081/crm
        </p>
    </section>
</body>
<script src="./js/jquery.min.js"></script>
<script>
    let box = document.querySelector('.box');
    const xhr1 = new XMLHttpRequest();
    xhr1.open('get','http://chst.vip:1234/api/getsitenav',false);
    xhr1.onload = function(){
        if(xhr1.status === 200){
            let res1 = JSON.parse(xhr1.responseText);
            console.log((res1.result));
            let lis = '';
            let regExp = /^<[^<]+\s+src="([^''""]*)"/;
            res1.result.forEach((item,index) => {
        
                lis += `<li>
                            <a href="${item.navHref}">
                                <img src="${item.navImg}" alt="${item.navId}">
                                <span>${item.navTitle}</span>
                            </a>
                        </li>`
            });
            box.innerHTML = lis;
        }
    }
    xhr1.send(null);

$(function(){
    $('.back').click(function(){
        location.href="./商品首页.html"
    })
})
   
</script>
</html>